<!--

Copyright 2011 Google Inc. All Rights Reserved.

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

    http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.

-->

<!doctype html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>Street Identity AP</title>

<link rel="stylesheet" href="/static/blueprint/screen.css" type="text/css"
  media="screen, projection">
<link rel="stylesheet" href="/static/blueprint/print.css" type="text/css"
  media="print">
<link rel="stylesheet" href="/static/blueprint/src/forms.css" type="text/css"
  media="print">
<!-- Import fancy-type plugin. -->
<link rel="stylesheet" href="/static/blueprint/plugins/fancy-type/screen.css"
  type="text/css" media="screen, projection" />

<!--[if lt IE 8]><link rel="stylesheet" href="../../blueprint/ie.css" type="text/css" media="screen, projection"><![endif]-->

<link rel="stylesheet" href="/static/style.css" type="text/css" />
    <script src="https://ajax.googleapis.com/ajax/libs/jquery/1.6.1/jquery.min.js" type="text/javascript"></script>
    <script>
        $(document).ready(function() {
            $("#add_address_button").click(function() {
                $("#add_address").fadeIn();
            });
        });
    </script>
</head>

<body>

  <div class="container">

    <div id="header" class="span-22 last prepend-top">
      <a href="/"><img src="/static/google_streetidentity.png"
        alt="Google Street Identity Project" /> </a>
    </div>

    <hr />
    <div id="subheader" class="span-24 last">
      <h3 class="alt">
        <strong>Attribute Provider</strong> allows you to store and verify your
        street address information.
      </h3>
    </div>
    <hr />
    <div class="span-15 colborder">
      <div class="span-15 last">
        <h3>Your Account</h3>

        <p class="box text">
          <strong>Display name:</strong> {{ user.display_name }}<br /> <strong>Email:</strong>
          {{ user.email }}
        </p>

        <hr />
        <h3>Your Addresses</h3>
        {% if address_list_empty %} {% for address in address_list %} 
        {% if address.verified %}
        <form action="/account/delete" method="post">
          <li class="text">
          {{ address.address }} ({{ address.type }}) - {{ address.desc }} - 
          <strong>VERIFIED</strong> <input type="hidden"
            value="{{address.key.id}}" name="address_id" /> <input
            type="submit" value="Delete" class="button" />
        </form>
        </li> {% else %}
        <form action="/account/verify" method="post">
          <li class="text">
          {{ address.address }} ({{ address.type }}) - {{ address.desc }}<br /> 
          <input type="hidden"
            value="{{address.key.id}}" name="address_id" /> <input type="text"
            value="...code..." name="code" /> <input type="submit"
            value="Verify" class="button" />
        </form>
        {% endif %} {% endfor %}
        </ul>
        </p>
        {% else %}
        <p>You don't have any street addresses associated with your account,
          yet.</p>
        {% endif %}
        <hr />
        <input type="submit" value="Add new address" id="add_address_button" class="button"/>
        <p>
        <form id="add_address" action="/account" method="post" class="box" style="display: none;">

          <fieldset>
            <legend>Register New Address</legend>

            <p>
              <select name="address_type">
                <option value="home">Home</option>
                <option value="office">Office</option>
              </select>
            </p>

            <p>
              <label for="address">Address</label><br> <input type="text"
                class="text" id="address" name="address">
            </p>
            <p>
              <label for="desc">Description</label><br> <input type="desc"
                class="text" id="desc" name="desc">
            </p>
            <input type="submit" value="Add address" class="button"> <input
              type="reset" value="Reset" class="button">

          </fieldset>
        </form>

        </p>

      </div>

      <div class="span-15 colborder">
        <p class="text">
          <a href="/postcards">See my postcards</a> <a href="/sign_out">Sign
            out</a>
        </p>
      </div>
    </div>
        <div class="span-7 last">
      <img src="/static/streetidentity-ap.png"
        alt="Google Street Attribute Provider" width="310" />
    </div>
    <hr />
    <div class="span-3 last right">
      <img src="/static/google_logo_small.png" alt="Google Inc." align="right" />
    </div>
  </div>

</body>
</html>